/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kungkhies.mvc.kungkher;

import com.kungkhies.domain.kungkher.Kungkher;
import java.util.Comparator;

/**
 *
 * @author clayton
 */
public class KungkherComparator implements Comparator
{

    @Override
    public int compare(Object o1, Object o2)
    {
        Kungkher k1 = (Kungkher) o1;
        Kungkher k2 = (Kungkher) o2;
        
        int kungkherNameComp = k1.getKungkherName().compareTo(k2.getKungkherName());
        
        return ((kungkherNameComp == 0) ? k1.getKungkherName().compareTo(
        k2.getKungkherName()) : kungkherNameComp);
        
    }
    
}